package com.dahuyou.tryy.too.parse.clazz.file.clazzfile.constantpool.item;

import com.dahuyou.tryy.too.parse.clazz.file.clazzfile.ClassReader;
import com.dahuyou.tryy.too.parse.clazz.file.clazzfile.constantpool.ConstantInfo;

public class ConstantNameAndTypeInfo implements ConstantInfo {

     public int nameIdx;
     public int descIdx;

    @Override
    public void readInfo(ClassReader reader) {
//         this.nameIdx = reader.readUint16();
//         this.descIdx = reader.readUint16();
         this.nameIdx = reader.readU2();
         this.descIdx = reader.readU2();
    }

    @Override
    public int tag() {
        return this.CONSTANT_TAG_NAMEANDTYPE;
    }

    @Override
    public void showInfo() {
        System.out.println("tag 是：" + this.tag() + ", name and type 是：");
    }
}
